package system.struct;

/**
 * This implementation is used to describe the <i>Entry</i> of aggregation
 * information
 * <p>
 * This class contains three fields:
 * <p>
 * 1. qIndex: the index of query (this entry directs to)
 * <p>
 * 2. iidnex: the index of matched <i>Instance</i> in the query
 * <p>
 * 3. typicality: matching-typicality of this query under its concept
 * 
 * @author Jack
 * 
 */
public class AggEntry {
	int qIndex, iIndex;
	double typicality;

	/**
	 * Constructs an <tt>AggEntry</tt> using given <i>Query Index</i>, <i>Instance
	 * Index</i> and <i>Typicallity</i>
	 * 
	 * @param qIndex
	 *            <i>Query Index</i>
	 * @param iIndex
	 *            <i>Instance Index</i>
	 * @param typicality
	 *            <i>Typicallity</i>
	 */
	public AggEntry(int qIndex, int iIndex, double typicality) {
		this.qIndex = qIndex;
		this.iIndex = iIndex;
		this.typicality = typicality;
	}

	/**
	 * Returns <i>Query Index</i> of this <tt>AggEntry</tt>
	 * @return <i>Query Index</i> of this <tt>AggEntry</tt>
	 */
	public int qIndex() {
		return qIndex;
	}

	/**
	 * Returns <i>Instance Index</i> of this <tt>AggEntry</tt>
	 * @return <i>Instance Index</i> of this <tt>AggEntry</tt>
	 */
	public int iIndex() {
		return iIndex;
	}

	public String toString() {
		return qIndex + "\t" + iIndex + "\t" + typicality;
	}
}